<?php 
defined('o') || exit('404 not find file'); //防跳墙

class message extends model{

	public function upmessage($message_id,$new_val){
		return $this->updata(array('message_val'=>$new_val), " message_id=$message_id");
	}

	public function addmessage($arr){
		if (is_array($arr)) {
			return $this->adddata($arr);
		}
	}

	public function queryid($goods_id,$type_id){
		$rel = $this->querydata(array('message_id','message_val')," where goods_id=$goods_id and type_id=$type_id ");
		if (!empty($rel)) {
			foreach ($rel as $key => $value) {
				$arr = $value;
				break;
			}
			return $arr;
		}
		return false;
	}

}


?>